package com.zhn.evsi.controller.Evsi;

import com.zhn.evsi.common.Result;
import com.zhn.evsi.domain.dto.evsi.*;
import com.zhn.evsi.domain.entity.evsi.EvsiInvtypes;
import com.zhn.evsi.domain.entity.evsi.EvsiMarketgroups;
import com.zhn.evsi.service.IEvsiCharacterSkillsService;
import com.zhn.evsi.service.IEvsiMarketgroupsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api(tags = "角色技能管理")
@ApiSort(value = 3)
@RestController
@RequestMapping("Evsi/skills")
public class EvsiCharacterSkillsController {

    @Autowired
    private IEvsiCharacterSkillsService evsiCharacterSkillsService;

    @Autowired
    private IEvsiMarketgroupsService marketgroupsService;

    @ApiOperation("技能学习队列")
    @ApiOperationSupport(order = 1)
    @GetMapping("/skillQueue")
    public Result skillQueue() {
        return Result.success(evsiCharacterSkillsService.skillQueue());
    }

    @ApiOperation("获取技能列表")
    @ApiOperationSupport(order = 2)
    @GetMapping("/skillList")
    public Result skillList() {
        return Result.success(evsiCharacterSkillsService.skillList());
    }

    @ApiOperation("技能All（树状结构）")
    @ApiOperationSupport(order = 3)
    @GetMapping("/skillAll")
    public Result skillAll() {
        return Result.success(evsiCharacterSkillsService.skillAll());
    }

    @ApiOperation("获取角色属性点")
    @ApiOperationSupport(order = 4)
    @GetMapping("/attributes")
    public Result attributes() {
        return Result.success(evsiCharacterSkillsService.attributes());
    }

    @ApiOperation("舰船获取技能信息下拉菜单(树状结构)")
    @ApiOperationSupport(order = 5)
    @GetMapping("/selectCustomization")
    public Result selectCustomization() {
        return Result.success(marketgroupsService.groupsMenu(4));
    }

    @ApiOperation("舰船获取技能信息下拉菜单二级分层查询")
    @ApiOperationSupport(order = 6)
    @GetMapping("/groupsCustomization")
    public Result groupsCustomization(@RequestParam Integer marketGroupId) {
        return Result.success(marketgroupsService.groupsType(marketGroupId));
    }

    @ApiOperation("根据舰船获取技能信息")
    @ApiOperationSupport(order = 7)
    @GetMapping("/customization")
    public Result customization(@RequestParam Integer TypeId,
                                @RequestParam Integer level) {
        return Result.success(evsiCharacterSkillsService.customization(TypeId, level));
    }

    @ApiOperation("技能规划")
    @ApiOperationSupport(order = 8)
    @GetMapping("/skillPlan")
    public Result skillPlan() {
        // 挑选几个舰船，然后训练看技能规划
        evsiCharacterSkillsService.skillPlan();
        return Result.success();
    }
}
